package com.lzc.controller;

import com.lzc.pojo.vo.Result;
import com.lzc.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/im/message")
public class MessageController {

    @Autowired
    private MessageService messageService;

    /**
     * 找到历史消息记录
     * @param rid 聊天的用户id
     * @return
     */
    @PostMapping("/find/historical/{rid}")
    public Result findHistorical(@PathVariable("rid") Long rid){

        return messageService.findHistoricalMessages(rid);
    }

}
